Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 2357fdb83cf24ec50c93cf88f7da3712991873f8


Parents : c83691d
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-03T22:41:15-06:00

feat(SettingsPage.vue): update config handling with default values and safe access method

Changes

1 files changed, 26 insertions(+), 2 deletions(-)


Diff

diff --git a/meshchatx/src/frontend/components/settings/SettingsPage.vue b/meshchatx/src/frontend/components/settings/SettingsPage.vue
index c965a0ff..8ff4305d 100644
--- a/meshchatx/src/frontend/components/settings/SettingsPage.vue
+++ b/meshchatx/src/frontend/components/settings/SettingsPage.vue
@@ -1,5 +1,6 @@
<template>
<div
+ v-if="config"
class="flex flex-col flex-1 overflow-hidden min-w-0 bg-gradient-to-br from-slate-50 via-slate-100 to-white dark:from-zinc-950 dark:via-zinc-900 dark:to-zinc-900"
>
<div class="flex-1 overflow-y-auto w-full px-4 md:px-8 py-6">
@@ -851,6 +852,11 @@ export default {
ElectronUtils,
KeyboardShortcuts,
config: {
+ display_name: "",
+ identity_hash: "",
+ lxmf_address_hash: "",
+ theme: "dark",
+ is_transport_enabled: false,
auto_resend_failed_messages_when_announce_received: null,
allow_auto_resending_failed_messages_with_attachments: null,
auto_send_failed_messages_to_propagation_node: null,
@@ -867,6 +873,20 @@ export default {
reloadingRns: false,
};
},
+ computed: {
+ safeConfig() {
+ if (!this.config) {
+ this.config = {
+ display_name: "",
+ identity_hash: "",
+ lxmf_address_hash: "",
+ theme: "dark",
+ is_transport_enabled: false,
+ };
+ }
+ return this.config;
+ },
+ },
beforeUnmount() {
// stop listening for websocket messages
WebSocketConnection.off("message", this.onWebsocketMessage);
@@ -882,7 +902,9 @@ export default {
const json = JSON.parse(message.data);
switch (json.type) {
case "config": {
- this.config = json.config;
+ if (json.config) {
+ this.config = { ...this.config, ...json.config };
+ }
break;
}
case "keyboard_shortcuts": {
@@ -894,7 +916,9 @@ export default {
async getConfig() {
try {
const response = await window.axios.get("/api/v1/config");
- this.config = response.data.config;
+ if (response?.data?.config) {
+ this.config = { ...this.config, ...response.data.config };
+ }
this.getKeyboardShortcuts();
} catch (e) {
// do nothing if failed to load config


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────